﻿<Window x:Class="BeeCoders.Tools.ControlCanvas.DemoApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:ControlCanvas="clr-namespace:BeeCoders.Tools.ControlCanvas;assembly=BeeCoders.Tools.ControlCanvas" 
		xmlns:Controls="clr-namespace:BeeCoders.Tools.ControlCanvas.Controls;assembly=BeeCoders.Tools.ControlCanvas" 
		Title="BeeCoders ControlCanvas Demo v0.9.1 - www.beecoders.com" Height="479" Width="995">
	<Grid>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="150" />
			<ColumnDefinition Width="*" />
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition Height="32" />
			<RowDefinition Height="32" />
			<RowDefinition Height="170*" />
			<RowDefinition Height="20" />
		</Grid.RowDefinitions>

		<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="0">
			<ToggleButton Name="IsInDesign"
						  Content="Design Mode" 
						  Margin="2"
						  IsChecked="{Binding ElementName=MainCanvas,Path=IsInDesignMode}">

			</ToggleButton>
			<ToggleButton Name="ShowGridLinesButton"
						  Content="Show Grid Lines" 
						  Margin="2"
						  IsChecked="{Binding ElementName=MainCanvas,Path=ShowGridLines}">

			</ToggleButton>
			<ToggleButton Name="IsLinkedControlSelectionButton"
						  Content="Linked Control Selection" 
						  Margin="2"
						  IsChecked="{Binding ElementName=MainCanvas,Path=IsLinkedControlSelection}">

			</ToggleButton>
			<ToggleButton Name="SnapToGridButton"
						  Content="Snap To Grid" 
						  Margin="2">

			</ToggleButton>

			<TextBox Name="lblGridXOffset"
					 IsEnabled="False">Grid X:</TextBox>
			<TextBox Name="SnapOffsetX">20</TextBox>

			<TextBox Name="lblGridYOffset"
					 IsEnabled="False">Grid Y:</TextBox>
			<TextBox Name="SnapOffsetY">20</TextBox>


		</StackPanel>

		<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1">
			<Button Name="AlignLeft"
						  Margin="2"
						  Content="{StaticResource AlignLeftIcon}"
						  Click="AlignLeftClick">
			</Button>
			<Button Name="AlignRight"
						  Margin="2"
						  Content="{StaticResource AlignRightIcon}"
						  Click="AlignRightClick">
			</Button>

			<Button Name="AlignTop"
					Content="{StaticResource AlignTopIcon}"
  				    Margin="2"
		            Click="AlignTopClick">

			</Button>
			<Button Name="AlignBottom"
					Margin="2"
					Content="{StaticResource AlignBottomIcon}"
					Click="AlignBottomClick">
			</Button>
			<Button Name="AlignHorMiddles"
					Margin="2"
					Content="{StaticResource AlignHorMiddlesIcon}"
					Click="AlignHorMiddlesClick">
			</Button>
			<Button Name="AlignVerMiddles"
					Margin="2"
					Content="{StaticResource AlignVerMiddlesIcon}"
					Click="AlignVerMiddlesClick">
			</Button>
			
		</StackPanel>

		<StackPanel Orientation="Vertical" Grid.Row="1" Grid.RowSpan="3">
			<Button Name="AddLabel"
					Click="AddLabelClick">
				Add Label
			</Button>
			<Button Name="AddTextBox"
					Click="AddTextBoxClick">
				Add Text Box
			</Button>
			<Button Name="AddNumericTextBox"
					Click="AddNumericTextBoxClick">
				Add Numeric Text Box
			</Button>
			<Button Name="AddDopDown"
					Click="AddDropDownClick">
				Add Drop Down
			</Button>
			<Button Name="AddCheckBox"
					Click="AddCheckBoxClick">
				Add Check Box
			</Button>
			<Button Name="AddDateTime"
					Click="AddDateTimeClick">
				Add DateTime
			</Button>
			<Button Name="AddCalendar"
					Click="AddCalendarClick">
				Add Calendar
			</Button>
			<Button Name="AddLinkedTextbox"
					Click="AddLinkedTextboxClick">
				Add Linked Text Box
			</Button>
			<Button Name="RemoveSelected"
					Click="RemoveSelectedClick"
					Margin="0,10,0,0">
				Remove Selected
			</Button>
			<Button Name="SaveToXml"
					Click="SaveToXmlClick"
					Margin="0,10,0,0">
				Save To Xml File
			</Button>
			<Button Name="LoadFromXml"
					Click="LoadFromXmlClick"
					Margin="0,0,0,0">
				Load From Xml File
			</Button>
		</StackPanel>

		<ControlCanvas:DesignerCanvas Name="MainCanvas" 
									   Background="#FFE8E8E8" Grid.Row="2" Grid.Column="1"
									  IsInDesignMode="{Binding ElementName=IsInDesign,Path=IsChecked}"
									  ShowGridLines="{Binding ElementName=ShowGridLinesButton,Path=IsChecked}"
									  SnapOffsetX="{Binding ElementName=SnapOffsetX,Path=Text}"
									  SnapOffsetY="{Binding ElementName=SnapOffsetY,Path=Text}"
									  IsSnapToGrid="{Binding ElementName=SnapToGridButton,Path=IsChecked}">

			<!--<ControlCanvas:DesignerItem Width="138" Height="50" Canvas.Top="10" Canvas.Left="50">
				<Controls:TextBoxControl></Controls:TextBoxControl>
			</ControlCanvas:DesignerItem>-->
		</ControlCanvas:DesignerCanvas>
		<TextBlock Grid.Row="3" Grid.ColumnSpan="2">Visit www.beecoders.com if you want more information and examples on how to use this component.</TextBlock>
	</Grid>

</Window>
